package com.fhz.mvvm.ui.main.datasource;

import androidx.databinding.ObservableList;
import androidx.lifecycle.LiveData;

import com.fhz.mvvm.dao.AppDataBase;
import com.fhz.mvvm.dao.GoodsInfoDao;
import com.fhz.mvvm.entity.GoodsInfoLocal;

import java.util.List;

import javax.inject.Inject;

import io.reactivex.Observable;

/**
 * 时间:2023/8/17
 *
 * @author Mr.Feng
 * 简述: 本地数据依赖于room
 */
public class MainLocalDataSource {
    //创建room的操作dao

    @Inject
    GoodsInfoDao mGoodsInfoDao;

    @Inject
    public MainLocalDataSource() {
    }

    public void insertGoodsInfo(GoodsInfoLocal goodsInfoLocal){
         mGoodsInfoDao.insertGoodsInfo(goodsInfoLocal);
    }

    public LiveData<List<GoodsInfoLocal>> getAllGoods(){
        return mGoodsInfoDao.getAllGoods();
    }
}
